CX_ATTRIBUTE
Class hierarchy
- CX_CLASS
- CX_SIMPLE
- CX_TERMED
- CX_EXPANDABLE
- CX_ATTRIBUTE
- CX_EXPANDABLE
- CX_TERMED
- CX_SIMPLE
Description:
In ClassiX® any data fields can be dynamically defined and additionally stored in all business objects at any time (so-called dynamic data fields or slots). These data fields are usually defined by the system administrator in connection with the extension of the applications/screen masks from which these data fields can be maintained.
These dynamic data fields are initially only variables of a certain type. However, if you want to specify the standard unit for a variable of the type value (CX_VALUE), for example, or give these dynamic variables a certain designation - which can be freely entered by the user - you need objects that encapsulate or encapsulate these dynamic variables. This is exactly what the objects of the class of type CX_ATTRIBUTE do.
Objects of type CX_ATTRIBUTE are used in particular to specify the characteristics of a company.
Each dynamic data field can be described several times - also in the form of different attribute objects. For example, in a certain context the area can be entered manually (e.g. encapsulation of the slot 'area' as the default attribute CX_SLOT_ATTRIBUTE), in another context it should be calculated automatically (e.g. encapsulation of the slot 'area' as the calculated attribute CX_FORMULA_ATTRIBUTE).
If a dynamic data field is to change its type as attribute object, this can be done via the general validity mechanism of ClassiX® (SpanDateValidity()).
The CX_ATTRIBUTE classes in detail:
CX_SLOT_ATTRIBUTE allows a dynamic data field to be given a descriptive name, additional explanatory data or a default value.
CX_FORMULA_ATTRIBUTE encapsulates a formula as a dynamic data field: Each query of the value of the dynamic variable automatically leads to the evaluation of the formula and return of the result (e.g. dynamic data field "area" with formula "length" * "width").
CX_CONDITIONED_ATTRIBUTE encapsulates a conditional table CX_CONDITIONED_BAG as a dynamic data field: Each query of the value of the dynamic variable automatically results in a query of the table and return of the result (e.g. dynamic data field "price" with table whose entries are conditional of a "quantity").
The management of several CX_ATTRIBUTE objects is taken over by the class CX_ATTRIBUTE_SET, which is quasi an extension of a business object. Such a CX_ATTRIBUTE_SET can also be reached via a CX_CONDITIONED_BAG, if different attribute value spaces are to be modelled depending on certain conditions.
On a next higher level, it should be possible for every user to assign any characteristics to certain objects, e.g. to provide an article with information on colour, diameter or weight. Here it is a priori not known which data field is used where.
The classes of type CX_ATTRIBUTE describe the characteristics of an enterprise from the application(s) point of view.
Each dynamic data field can be described several times in the form of various attribute objects. E.g. in a certain context the area can be entered manually (definition of the slot area as CX_DEFAULT_ATTRIBUTE), in another context it should be calculated automatically (definition of the slot area as CX_FORMULA_ATTRIBUTE).
If an attribute object is to change its type, this can be done using the validity mechanism.
The administration of different CX_ATTRIBUT objects is taken over by the class CX_ATTRIBUTE_SET, which is quasi an extension of an object. Such a CX_ATTRIBUTE_SET can also be reached via a CX_CONDITIONED_BAG, if different attribute value spaces are to be modelled depending on certain conditions.
The class CX_SLOT_ATTRIBUTE establishes the connection to the dynamic data fields or slots. CX_SLOT_ATTRIBUTE refers to a dynamic data field (slot) and allows, for example, to give the data field a descriptive name.
CX_CONDITIONED_ATTRIBUTE, CX_FORMULA_ATTRIBUTE and CX_DEFAULT_ATTRIBUTE are derived from it.
CX_DEFAULT_ATTRIBUTE describes dynamic data fields that are normally required to be entered and must therefore have possible default settings. The possible default value of the slot is kept in the defaultValue Container.
CX_DEFAULT_ATTRIBUTE also holds constraints that are evaluated by a BOOL formula FIXME: Function IsValid ???
CX_SLOT_ATTRIBUTE and CX_DEFAULT_ATTRIBUTE are of the type of a so-called value attribute, i.e. they directly represent a value (function IsValueType()) that can be edited (function Value()).
Articles hold CX_DEFAULT_ATTRIBUTE in their characteristic bar to include values. These values can always be changed back to the default value (function DefaultValue()). Parts hold CX_SLOT_ATTRIBUTE, because here only the value has to be specified directly.
A CX_FORMULA_ATTRIBUTE can be given parameters for its own formula in its own frame, e.g. sub-formulas, etc., e.g. (l=) a + 5, where a is a slot in the frame of the CX_FORMULA_ATTRIBUTE for the value l. a could therefore be a conditioned_bag itself.
(Example: attribute area = attribute length * attribute width)
With a CX_CONDITIONED_ATTRIBUTE the values of an attribute are linked to conditions. These conditions can be values of other attributes, making the value of this CONDITIONED_ATTRIBUTE attribute dependent on the value of others.
(Example: If mounting point = right or = both sides then lengthwise right = length; If mounting point = left or = both sides then lengthwise left = length)
OPEN
=====
Check CopyConstructor of CX_CONDITIONED_ATTRIBUTE
Code example:
Function | MA* | Parameters | Return | Brief description |
---|---|---|---|---|
ElementOf | CX_VALUE | CX_BOOLEAN | ||
HasConstraint | * | Validity available? | ||
UnconditionalValue | * | Value of the slot - ignore constraints | ||
UnconditionalValueObject | ANY | Value of the slot - ignore constraints | ||
Value | * | Returns an error, because Value has no meaning for this class. | ||
ValueObject | ANY | Returns an error, because Value has no meaning for this class. |
- MA = Member Access function,
grey background = inherited function
Data field | Type | Reference class | I* | Brief description |
---|---|---|---|---|
attributeEnum | ENUMSHORT | Type | ||
constraint | POINTER | CX_FORMULA | An optional formula that checks whether the attribute value (for Put via Value()) is within the valid value range for this attribute. If a value is entered for which this formula evaluates to FALSE, the user is notified of the input error. See example: Value check in attribute maintenance mask This check is skipped with UnconditionalValue(). | |
uniqueID | STRING | * | Unique key | |
validity | POINTER | CX_VALIDITY | Validity period of the object |
- I = Indexable data field,
grey background = inherited data field
Module | Brief description | |
---|---|---|
attribute.mod | Characteristics Basic module | |
attriedt.mod | Features of the editing module | |
attrisel.mod | Characteristics Selection module | |
attrfedt.mod | Calculated features Editing module | |
attrfsel.mod | attribute.htm | attrform.htm | Calculated characteristics Selection module |
attrsedt.mod | Presettable features Editing module | |
attrssel.mod | attribute.htm | attrslot.htm | Presettable features Selection module |
attrise2.mod | Characteristics Selection module | |
testform.mod | Testing Formula Module | |
dynbind.mod | Dynamic binding of variables |